import React, {useEffect} from 'react';
import { useModel, IRouteComponentProps } from 'umi';
import styles from ".././index/topic.less"
const TopicPage:React.FC<IRouteComponentProps> = ({history}) => {
  let {topicList, topicInfo, getTopicListAction} = useModel('topic');

  // 获取专题页数据
  useEffect(()=>{
    getTopicListAction({page: 1, size: 5});
  }, [])

  console.log('topicList...', topicList);

    return (
        <div>
            {
                topicList.map((item,index)=>{
                    return <div key={item.id} 
                    className={styles.item}
                    onClick={()=>history.push(`/topicDetails/${item.id}`)}>
                        <img src={item.scene_pic_url}/>
                        <span>{item.title}</span>
                        <p>{item.subtitle}</p>
                        <li>{item.price_info}元/起</li>
                    </div>
                })

               
            }

        </div>
    );
}

export default TopicPage;